import java.util.logging.Level;


/**
 * MainDriver
 * Runs the main method of the program
 * 
 * @author Bethany Sumner
 * @version 1.0
 *
 *
 *  Date           	Name            	Action
 *  --------------------------------------------------------------------------------------
 *	03/06/11		Bethany				Created Class
 *  04/05/11		Zachary				Made a JTabbedPane out of this
 *  04/13/11		Bethany				Simplified: moved functions to MainWindow.java and LoginPanel.java
 *
 *
 */

public class MainDriver {
	
	/**
	 * Main driver of the Doctor Office Support System - connects with database, opens window
	 * @param args Command line arguments
	 */
	public static void main(String[] args){
		
		//sx33netConnect(); // connect to the unreliable database
		anybethConnect();   // connect to db on bethany's server space
		
		
	}
	
	/**
	 * Connnects to database on sx33.net
	 */
	public static void sx33netConnect(){
		String username = "coding2_med";
		String password = "ZioVJ57F";
		String dbms = "mysql";
		String dbName = "coding2_med";
		String serverName = "codingquad.sx33.net";
		String portNumber = "3306";
		
		try {
			System.out.println("Attempting to connect now...");
			Database db = new Database(username, password, dbms, serverName, portNumber, dbName);
			System.out.println("Connected to database");
			MainWindow main = new MainWindow(db);
			db.viewAllUsers(); //prints out all users so we can know what login credentials to test
		} catch (Exception e) {
			System.out.println("Error Connecting to Database");
			e.printStackTrace();
		} 
	}
	
	/**
	 * Connects to database on anybeth.com
	 */
	public static void anybethConnect(){
		String username = "codingquad";
		String password = "ZioVJ57F";
		String dbms = "mysql";
		String dbName = "cs2340_db";
		String serverName = "cs2340.anybeth.com";
		String portNumber = "3306";
		
		try {
			System.out.println("Attempting to connect now...");
			Database db = new Database(username, password, dbms, serverName, portNumber, dbName);
			System.out.println("Connected to database");
			MainWindow main = new MainWindow(db);
			db.viewAllUsers(); //prints out all users so we can know what login credentials to test
		} catch (Exception e) {
			System.out.println("Error Connecting to Database");
		}

	}

	
}
